﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Xml.Serialization;

namespace System.Data.DataSetGenerator
{
    [Serializable]
    [XmlType(TypeName = "DataTable")]
    public class TableDescriptor
    {
        public TableDescriptor()
        {
            Util.InitializeObject(this);
        }

        [XmlAttribute]
        [DefaultValue("")]
        public String TableName { get; set; }

        private ColumnCollection columnsToExclude;

        [DefaultValue(null)]
        [XmlArray(IsNullable = true)]
        public ColumnCollection ColumnsToExclude
        {
            get
            {
                if (columnsToExclude == null)
                    columnsToExclude = new ColumnCollection();
                return columnsToExclude;
            }
        }

        private ColumnCollection columnsToInclude;

        [DefaultValue(null)]
        [XmlArray(IsNullable=true)]
        public ColumnCollection ColumnsToInclude
        {
            get
            {
                if (columnsToInclude == null)
                    columnsToInclude = new ColumnCollection();
                return columnsToInclude;
            }
        }

        [XmlAttribute]
        [DefaultValue("")]
        public String Source { get; set; }

        [XmlAttribute]
        [DefaultValue(-1)]
        public int AutoincrementSeed { get; set; }

        [XmlAttribute]
        [DefaultValue(-1)]
        public int AutoincrementStep { get; set; }

        [DefaultValue(SchemaObjectActionEnum.Add)]
        [XmlAttribute]
        public SchemaObjectActionEnum Action { get; set; }

        [DefaultValue(false)]
        [XmlAttribute]
        public bool IgnoreIndexes { get; set; }
    }
}
